﻿using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace BeeTest.Samples.FooTests
{
    [TestClass]
    public class FooTests : BehaviorTestBase
    {
        [TestMethod]
        public void UselessTest()
        {
            this.Given()
                .When(() => { })
                .Then(() => { });
        }

        [TestMethod]
        public void StaticGiven()
        {
            this.Given(InitFoo);
        }

        [TestMethod]
        public void GivenReturningInstance()
        {
            this.Returns.Given(FooCreated);
        }

        [TestMethod]
        public void GivenMultipleInstances()
        {
            this.Returns.Given(FooCreated)
                .And.Returns.Given(CreateWithParent, State<Foo>.Given0)
                .And.Returns.Given(CreateWithParent, State<Foo, Foo>.Given1)
                .And.Returns.Given(CreateWithParent, State<Foo, Foo, Foo>.Given2);
        }

        private Foo CreateWithParent(Foo parent)
        {
            return null;
        }

        private Foo FooCreated()
        {
            return new Foo();
        }

        private void InitFoo()
        {
            Foo.SInit();
        }
    }
}
